﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Irandeb4.Models
{
    public class Item
    {
        public long ItemId { get; set; }
        public int ProductId { get; set; }

        [Required(ErrorMessage = "por favor introduzca un cantidad")]
        [RegularExpression(@"^[0-9]{0,10000}", ErrorMessage = "La cantidad solo permite numeros")]
        public int Amount { get; set; }

        [Required(ErrorMessage = "por favor introduzca la descripcion")]
        [StringLength(100, MinimumLength = 5, ErrorMessage = "La descripcion debe ser de minimo 5 cararteres y maximo 100")]
        public string Description { get; set; }
        
        public virtual Product Product { get; set; }
    }
}